package cc.linker.steplink.crm.merchanth5.dao;

import lombok.Data;
import org.springframework.util.StringUtils;

@Data
public class QuotaPo {
    //优惠券id
    public Long vipId;
    //优惠券名称
    public String vipName;
    //等级
    public Integer level;
    //等级名称
    public String levelName;
    //限购类型1:一直可购买 2开通几天内
    public Integer quotaType=1;
    //天数
    public Integer quotaDay=0;
    //vip限购提示
    public String vipTip;
    //等级限购提示
    public String levelTip;

    public String getVipTip() {
        if(!StringUtils.isEmpty(this.vipName)){
            if(this.quotaType==1){
                return "开通"+this.vipName+"可购买";
            }
            if(this.quotaType==2){
                return "新开通"+this.vipName+"  "+this.quotaDay+"天内可购买";
            }
        }
        return "";
    }

    public String getLevelTip() {
        if(!StringUtils.isEmpty(this.levelName)) {
            if (this.level != null) {
                if (this.quotaType == 1) {
                    return "大于等于" + this.levelName + "可购买";
                }
                if (this.quotaType == 2) {
                    return "新升级" + this.levelName+"  "+ this.quotaDay + "天内可购买";
                }
            }
        }
        return "";
    }
}
